<ion-header>
    <ion-toolbar content-page>
        <ion-buttons start>
            <button ion-button icon-only (click)="backToProPage()">
                <i class="toolbar-back"></i>
            </button>
        </ion-buttons>
        <ion-title>准客户详情</ion-title>
        <ion-buttons end>
            <button ion-button icon-only adpmenutoggle>
                <i class="toolbar-menu"></i>
            </button>
        </ion-buttons>
    </ion-toolbar>
    <div class="base-info">
        <div class="baseMessage">
            <div class="client-panel part">
                <p class="base-msg"
                   [ngClass]="{'':clientLData.name && clientLData.name.length>18,
                   'nameMarginBottom1':18>clientLData.name && clientLData.name.length>9,
                   'nameMarginBottom3':clientLData.name && clientLData.name.length<9}">
                    <!--<i class="vipType" [ngClass]="{'gold':clientLData.vipFlag == 1,'platinum':clientLData.vipFlag == 2,'diamond':clientLData.vipFlag == 3,'supreme':clientLData.vipFlag == 4}"></i>-->
                    <img src="{{clientAvatar}}" *ngIf="clientAvatar" class="sex-content"/>
                    <span class="name-content" [class.load]="!requestStatus">{{clientLData.name?clientLData.name:'-'}}</span>
                    <span class="age-content" *ngIf="clientLData.age">{{clientLData.age}}岁</span>
                </p>
            </div>
            <div class="collect-panel"  *ngIf="requestStatus&&isNull" [class.isFavorited]="isFavorited" (click)="collectClickHandle()">
                <i></i>
                <span>{{isFavorited?'已收藏':'收藏'}}</span>
            </div>
        </div>
    </div>
</ion-header>

<ion-content>
    <div class="main-content">
        <div *ngFor="let a of mapAddress">{{a}}</div>
        <!-- 销售线索 -->
        <div class="panel panel-border saleLeads">
            <p>销售线索</p>
            <p class="signList"><span *ngFor="let a of leadsList" (click)="goToleadsList(a)">{{a}}</span> <span
                class="leadsMore">…</span></p>
        </div>
        <div class="panel panel-border">
            <div class="panel">
                <div class="panel-title">
                    <span>客户信息</span>
                    <button type="button" (click)="goToEdit()">
                        <i class="icon-edit"></i>
                        <span>编辑</span>
                    </button>
                </div>
                <div class="panel-item nameLengthBox device-pixel-border-bottom">
                    <span>姓名</span>
                    <span class="nameLength" [class.empty]="!clientLData.name">{{clientLData.name?clientLData.name:'-'}}</span>
                </div>
                <div class="panel-item device-pixel-border-bottom">
                    <span>性别</span>
                    <span [class.empty]="!clientLData.sex">{{clientLData.sex? (clientLData.sex=='M'?'男':'女') :'-'}}</span>
                </div>
                <div class="panel-item device-pixel-border-bottom">
                    <span>生日</span>
                    <span [class.empty]="!clientLData.birthDate">{{ clientLData.birthDate?(clientLData.birthDate| dateTrans:'YYYY/MM/DD'):'-'}}</span>
                    <!--<span>{{birthFormat(clientLData.birthDate?clientLData.birthDate:'')}}</span>-->
                </div>
                <div class="panel-item phoneBox device-pixel-border-bottom"
                     *ngFor="let phone of (clientLData.mobileList && clientLData.mobileList.length>0&&clientLData.mobileList[0].mobile)?clientLData.mobileList:emptyPhone index as index">
                    <span>电话{{index>=1?index+1:''}}</span>
                    <span class="phoneNum" [class.empty]="!phone.mobile">{{phone.mobile?phone.mobile:'-'}}</span>
                </div>
                <div class="addressBox"
                    *ngFor="let address of (clientLData.addressList && clientLData.addressList.length>0)?clientLData.addressList:emptyAddress index as index">
                    <div class="panel-item word-break device-pixel-border-bottom">
                        <span>地址{{index>=1?index+1:''}}</span>
                        <span class="address" [class.empty]="!address.address">{{address.address? address.address:'-'}}
                            <span *ngIf="address.defaultIndicator==1">(定位)</span>
                        </span>
                    </div>
                    <div class="panel-item device-pixel-border-bottom">
                        <span>邮编{{index>=1?index+1:''}}</span>
                        <span [class.empty]="!address.postCode">{{address.postCode?address.postCode:'-'}}</span>
                    </div>
                </div>
                <!--<div class="panel-item">-->
                <!--<span>身份证有效期</span>-->
                <!--<span>{{clientLData.birthDate?clientLData.birthDate:''}}</span>-->
                <!--</div>-->
            </div>
            <div class="toggle-panel">
                <div class="toggle-head">
                    <button (click)="changeOtherInfoOpenStatus()">
                        <i [ngClass]="otherInfoOpenStatus?'up':'down'"></i>
                        <span>{{otherInfoOpenStatus?'收起':'更多'}}</span>
                    </button>
                </div>
                <div [ngStyle]="{display:otherInfoOpenStatus?'block':'none'}" class="panel">
                    <div class="panel-item device-pixel-border-bottom">
                        <span>月收入</span>
                        <span [class.empty]="!clientLData.income">{{clientLData.income | monthlyIncome}}</span>
                    </div>
                    <div class="panel-item word-break device-pixel-border-bottom">
                        <span>职业</span>
                        <span [class.empty]="!clientLData.occupation">{{clientLData.occupation?(clientLData.occupation=='旧代码'?'-':clientLData.occupation):'-'}}</span>
                    </div>
                    <div class="panel-item device-pixel-border-bottom">
                        <span>婚育</span>
                        <span *ngIf="clientLData.marriageType==1">已婚</span>
                        <span *ngIf="clientLData.marriageType==2">未婚</span>
                        <span *ngIf="clientLData.marriageType==3">其他</span>
                        <span *ngIf="!clientLData.marriageType" class="empty">-</span>
                    </div>
                    <div class="panel-item device-pixel-border-bottom">
                        <span>子女</span>
                        <span [class.empty]="!clientLData.childNum">{{clientLData.childNum?child[clientLData.childNum]:'-'}}</span>
                    </div>
                    <div class="panel-item device-pixel-border-bottom">
                        <span>住房</span>
                        <span [class.empty]="!clientLData.houseOwnership">{{clientLData.houseOwnership?(clientLData.houseOwnership==1?'租房':'自有'):'-'}}</span>
                    </div>
                    <div class="panel-item device-pixel-border-bottom">
                        <span>私家车</span>
                        <span [class.empty]="!clientLData.carOwnership">{{clientLData.carOwnership?(clientLData.carOwnership==1?'有':'无'):'-'}}</span>
                    </div>
                    <div class="panel-item device-pixel-border-bottom" [class.last]="clientLData.otherIns!=1">
                        <span>是否在其他公司购买保险</span>
                        <span [class.empty]="!clientLData.otherIns">{{clientLData.otherIns?(clientLData.otherIns==1?'有':'无'):'-'}}</span>
                    </div>
                    <div class="panel-item device-pixel-border-bottom" [class.last]="clientLData.otherIns==1" *ngIf="clientLData.otherIns==1">
                        <span>购买类型</span>
                        <span [class.empty]="!clientLData.insType">{{clientLData.insType?inType[clientLData.insType]:'-'}}</span>
                    </div>
                    <!--<div class="panel-item no-border">
                        <span>客户来源</span>
                        <span>{{clientLData.source?clientLData.source:'-'}}</span>
                    </div>-->
                </div>
            </div>
        </div>
        <!--<div class="panel panel-border">-->
        <!--<div class="panel-title">备注</div>-->
        <!--<div class="panel-item no-border">-->
        <!--<span>{{clientLData.remark?clientLData.remark:''}}</span>-->
        <!--<span></span>-->
        <!--</div>-->
        <!--</div>-->
        <!--跟踪情况-->
        <client-detail-progress *ngIf="getProgress.clientName" [typeNum]="1" [requestSuccess]="progressRequest" [pageStatus]="intoPage" [progressList]="progressList"
                                (detail)="goToNote(currentClientNum)"></client-detail-progress>
        <div class="del-panel">
            <button type="button" class="deleteBtn" (click)="deleteClient()">
                删&emsp;除
            </button>
        </div>
    </div>
    <ion-fab bottom center class="client-detail-btn-panel" *ngIf="requestStatus">
        <button ion-fab class="btn-box">
            <button class="btn-map btn-component" ion-button  (click)="goMap()" [disabled]="!clientLData.defaultAddress">
                <i></i>
                <span>地图</span>
            </button>
            <button class="btn-call btn-component" ion-button (click)="onePhoneCall()" [disabled]="!clientLData.mobileList[0]||!clientLData.mobileList[0].mobile">
                <i></i>
                <span>通话</span>
            </button>
        </button>
    </ion-fab>
    <!--<ion-select #selectMobile interface="action-sheet" cancelText="取消" class="phoneList">
        <ion-option *ngFor="let one of clientLData.mobileList index as index"
                    (ionSelect)="callPhone(one.mobile)">{{one.mobile}}</ion-option>
    </ion-select>-->
</ion-content>
